import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:nyh_motorcade_app/pages/home/home_page.dart';
import 'package:nyh_motorcade_app/pages/my/my_page.dart';
import 'package:nyh_motorcade_app/widgets/keep_alive_widget.dart';

class MainController extends GetxController {
  int currentIndex = 0;
  PageController pageController = PageController();
  List<Widget> pageList = [KeepAliveWidget(HomePage()), /*KeepAliveWidget(ReportFormsPage()),*/ KeepAliveWidget(MyPage())];

  void setCurrentIndex(int index) {
    if (currentIndex != index) {
      currentIndex = index;
      pageController.jumpToPage(currentIndex);
      update();
    }
  }
}
